package cn.dy.sbo.model;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import cn.common.lib.springside.entity.AutoIdEntity;
/**
 * 单据
 * @author mlv
 *
 */
@Entity
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Orders extends AutoIdEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String		innerCode;		//内部编号
	private String		smallCode;		//小提单号
	private String		bigCode;		//大提单号
	
	private String		importCode;		//客户进口单号
	
	private Date		orderDate;		//单据日期
	private Integer		orderTime;
	private Date		comfirmDate;		//报价确认日期
	private Integer		comfirmTime;
	private String		status;			//状态
	
	private User		customer;		//客户
	private Partner		partner;		//客户
	
	private String		cusName;
	private String		cusCode;
	private User		creater;		//创建人
	private String		createrName;
	private String		customerService;	//客服
	
	private Float	payables;		//应付款
	
	private Date		createDate;
	private Integer		createTime;
	
	private Date		updateDate;
	private Integer		updateTime;
	
	private String		canceled;
	private String		transfered;
	private String		lastName;
	
	private	String		goods;			//品名
	private	String		pickUpAddr;			//取货处
	private	String		destination;			//送货处
	private	String		typeCode;			
	private	String		currrncy;			
	private	String		cbmode;			
	private	String		lastFlowName;			
	private	Float		rate;			
	
	private FlowType	flowType;		//流程类别
	
	private Flow		currentFlow;	//当前流程
	
	private Long		biztype;
	
	private	Date		lastUpdateDate;
	
	private	Float		height;	//高
	private	Float		weight; //重
	private	Float		width;	//宽
	private	Float		length;	//长
	
	private String		weightUnit;	//重量单位
	private String		volumeUnit;	//体积单位
	
	@Column(length=200)
	public String getPickUpAddr() {
		return pickUpAddr;
	}

	public void setPickUpAddr(String pickUpAddr) {
		this.pickUpAddr = pickUpAddr;
	}
	@Column(length=200)
	public String getDestination() {
		return destination;
	}

	public void setDestination(String destination) {
		this.destination = destination;
	}
	@Column(length=40)
	public String getInnerCode() {
		return innerCode;
	}

	public void setInnerCode(String innerCode) {
		this.innerCode = innerCode;
	}

	@Column(length=40)
	public String getSmallCode() {
		return smallCode;
	}

	public void setSmallCode(String smallCode) {
		this.smallCode = smallCode;
	}

	@Column(length=40)
	public String getBigCode() {
		return bigCode;
	}

	public void setBigCode(String bigCode) {
		this.bigCode = bigCode;
	}

	@Column(length=40)
	public String getImportCode() {
		return importCode;
	}

	public void setImportCode(String importCode) {
		this.importCode = importCode;
	}

	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	@Column(length=10)
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@Column(length=10)
	public String getCurrrncy() {
		return currrncy;
	}

	public void setCurrrncy(String currrncy) {
		this.currrncy = currrncy;
	}

	public Float getRate() {
		return rate;
	}

	public void setRate(Float rate) {
		this.rate = rate;
	}

	@Column(length=200)
	public String getCusName() {
		return cusName;
	}

	public void setCusName(String cusName) {
		this.cusName = cusName;
	}
	@Column(length=20)
	public String getCusCode() {
		return cusCode;
	}

	public void setCusCode(String cusCode) {
		this.cusCode = cusCode;
	}
	
	@Column(length=100)
	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(length=20)
	public String getCreaterName() {
		return createrName;
	}

	public void setCreaterName(String createrName) {
		this.createrName = createrName;
	}

	
	public Integer getOrderTime() {
		return orderTime;
	}

	public void setOrderTime(Integer orderTime) {
		this.orderTime = orderTime;
	}

	public Integer getComfirmTime() {
		return comfirmTime;
	}

	public void setComfirmTime(Integer comfirmTime) {
		this.comfirmTime = comfirmTime;
	}

	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
	public User getCustomer() {
		return customer;
	}

	public void setCustomer(User customer) {
		this.customer = customer;
	}
	
	
	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
	public Partner getPartner() {
		return partner;
	}

	public void setPartner(Partner partner) {
		this.partner = partner;
	}

	public Float getPayables() {
		return payables;
	}

	public void setPayables(Float payables) {
		this.payables = payables;
	}

	public User getCreater() {
		return creater;
	}

	public void setCreater(User creater) {
		this.creater = creater;
	}

	@Column(length=20)
	public String getCustomerService() {
		return customerService;
	}

	public void setCustomerService(String customerService) {
		this.customerService = customerService;
	}
	@Column(length=20)
	public String getCbmode() {
		return cbmode;
	}

	public void setCbmode(String cbmode) {
		this.cbmode = cbmode;
	}
	@Column(length=50)
	public String getLastFlowName() {
		return lastFlowName;
	}

	public void setLastFlowName(String lastFlowName) {
		this.lastFlowName = lastFlowName;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Integer getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Integer createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Integer getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Integer updateTime) {
		this.updateTime = updateTime;
	}
	
	@Column(length=10)
	public String getTypeCode() {
		return typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}

	@Column(length=5)
	public String getCanceled() {
		return canceled;
	}

	public void setCanceled(String canceled) {
		this.canceled = canceled;
	}

	@Column(length=5)
	public String getTransfered() {
		return transfered;
	}

	public void setTransfered(String transfered) {
		this.transfered = transfered;
	}

	@Column(length=40)
	public String getGoods() {
		return goods;
	}

	public void setGoods(String goods) {
		this.goods = goods;
	}

	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
	public FlowType getFlowType() {
		return flowType;
	}

	public void setFlowType(FlowType flowType) {
		this.flowType = flowType;
	}

	public Date getLastUpdateDate() {
		return lastUpdateDate;
	}

	public void setLastUpdateDate(Date lastUpdate) {
		this.lastUpdateDate = lastUpdate;
	}

	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
	public Flow getCurrentFlow() {
		return currentFlow;
	}

	public void setCurrentFlow(Flow currentFlow) {
		this.currentFlow = currentFlow;
	}

	public Float getHeight() {
		return height;
	}

	public void setHeight(Float height) {
		this.height = height;
	}

	public Float getWeight() {
		return weight;
	}

	public void setWeight(Float weight) {
		this.weight = weight;
	}

	public Float getWidth() {
		return width;
	}

	public void setWidth(Float width) {
		this.width = width;
	}

	public Float getLength() {
		return length;
	}

	public void setLength(Float length) {
		this.length = length;
	}

	@Column(length=20)
	public String getWeightUnit() {
		return weightUnit;
	}

	public void setWeightUnit(String weightUnit) {
		this.weightUnit = weightUnit;
	}
	
	public Long getBiztype() {
		return biztype;
	}

	public void setBiztype(Long biztype) {
		this.biztype = biztype;
	}

	@Column(length=20)
	public String getVolumeUnit() {
		return volumeUnit;
	}

	public void setVolumeUnit(String volumeUnit) {
		this.volumeUnit = volumeUnit;
	}

	public Date getComfirmDate() {
		return comfirmDate;
	}

	public void setComfirmDate(Date comfirmDate) {
		this.comfirmDate = comfirmDate;
	}
	
	
}
